Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add promise support for fs.rm() #860

Merged
merged 1 commit into from
Jan 19, 2021
Merged

Add promise support for fs.rm() #860

merged 1 commit into from
Jan 19, 2021

Conversation

RyanZim
Copy link
Collaborator

@RyanZim RyanZim commented Jan 18, 2021

Fixes #841

Copy link
Contributor

@ChALkeR ChALkeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK.

When I attempted to test, other local tests fail on master, investigating.
Upd: with #861, tests pass.

Side note: not sure why this code needs universalify dep at all, since this already has Node.js 10 in engines, and Node.js >=8 has util.promisify support. Will check separately. Upd: has both promise and callback APIs.

@ChALkeR
Copy link
Contributor

ChALkeR commented Jan 19, 2021

Q: why not just export fs.promises.rm?

There are no versions of Node.js where fs.rm is available and fs.promises.rm isn't available.

Refs:

Upd: the answer is "to be compatible with both promises and callbacks".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promisify fs.rm
2 participants